<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%> 
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
 
<html> 
	<head>
		<title>User sign up page</title>
	</head>
	<body>
		Please provide the following information to sign up for your host account. <br/>
		
		<%String errorMessage=(String)request.getAttribute("errorMessage");%>
		<% if (errorMessage != null) {%>
		<font color="red"><%= errorMessage %></font>
		<% }%>

		<% String   userName = (String)request.getAttribute("userName");%>
		<% String   firstName = (String)request.getAttribute("firstname");%>
		<% String   lastName = (String)request.getAttribute("lastname");%>
		<% String   phoneNumber = (String)request.getAttribute("phonenumber");%>
		<% String   address = (String)request.getAttribute("address");%>
		<% String   email = (String)request.getAttribute("email");%>
		
		<html:form action="/userSignup">
			<table width="100%">		
				<tr valign="top">
					<td width="1%">&nbsp;</td>
					<td width="32%" align="right" nowrap="nowrap">User name:</td>
					<td colspan="2" width="67%">
						<html:text property="userName" value="<%=userName %>" /><html:errors property="userName"/><font color="purple">&nbsp;*</font>
					</td>
				</tr>
				
				<tr valign="top">
					<td width="1%">&nbsp;</td>
					<td width="32%" align="right" nowrap="nowrap">Email:</td>
					<td colspan="2" width="67%">
						<html:text property="email"  value="<%=email %>"/><html:errors property="email"/><font color="purple">&nbsp;*</font>
					</td>
				</tr>
				
				<tr valign="top">
					<td width="1%">&nbsp;</td>
					<td width="32%" align="right" nowrap="nowrap">Password:</td>
					<td colspan="2" width="67%">
						<html:password property="password"/><html:errors property="password"/><font color="purple">&nbsp;*</font>
					</td>
				</tr>
				
				<tr valign="top">
					<td width="1%">&nbsp;</td>
					<td width="32%" align="right" nowrap="nowrap">Confirm Password:</td>
					<td colspan="2" width="67%">
						<html:password property="confirmPassword"/><html:errors property="confirmPassword"/><font color="purple">&nbsp;*</font>
					</td>
				</tr>
				
				<tr valign="top">
					<td width="1%">&nbsp;</td>
					<td width="32%" align="right" nowrap="nowrap">First Name:</td>
					<td colspan="2" width="67%">
						<html:text property="firstName"  value="<%=firstName %>"/><html:errors property="firstName"/>
					</td>
				</tr>
				
				<tr valign="top">
					<td width="1%">&nbsp;</td>
					<td width="32%" align="right" nowrap="nowrap">Last Name:</td>
					<td colspan="2" width="67%">
						<html:text property="lastName"  value="<%=lastName %>"/><html:errors property="lastName"/>
					</td>
				</tr>
				
				<tr valign="top">
					<td width="1%">&nbsp;</td>
					<td width="32%" align="right" nowrap="nowrap">Address:</td>
					<td colspan="2" width="67%">
						<html:text property="address"  value="<%=address %>"/><html:errors property="address"/>
					</td>
				</tr>
				
				<tr valign="top">
					<td width="1%">&nbsp;</td>
					<td width="32%" align="right" nowrap="nowrap">Phone Number:</td>
					<td colspan="2" width="67%">
						<html:text property="phoneNumber"  value="<%=phoneNumber %>"/><html:errors property="phoneNumber"/>
					</td>
				</tr>
				
				<tr valign="top">
					<td width="1%">&nbsp;</td>
					<td width="32%" align="right" nowrap="nowrap"></td>
					<td colspan="2" width="67%">
						<html:submit value="Save"/><html:cancel/>
					</td>
				</tr>
			</table>
		</html:form>
	</body>
</html>

